package com.novel.download.service;

import com.novel.download.controller.resp.CatalogueResp;
import com.novel.download.controller.resp.SearchResp;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;

public interface NovelService {

    String getName();

    /**
     * 校验该地址是否有效
     *
     * @return true有效
     */
    Map<String, Boolean> ping();

    /**
     * 查找
     *
     * @return true有效
     */
    Map<String, List<SearchResp>> search(String bookName);

    /**
     * 展示目录
     *
     * @param url 目录地址
     * @param net
     */
    CatalogueResp catalogue(String url, String net);

    /**
     * 下载
     *
     * @param url      地址
     * @param net
     * @param response
     */
    void download(String url, String from, String net, HttpServletResponse response) throws Exception;

}
